module.exports = {
    login: 'SELECT id,username,password FROM et_user WHERE username = ? limit 1',
    online: 'UPDATE et_user_profile SET online = \'Y\' WHERE user_id = ?',
    offline: 'UPDATE et_user_profile SET offline = \'N\' WHERE user_id = ?',
    register: {
        has_user: 'SELECT 1 FROM et_user WHERE username = 1',
        user: "INSERT INTO et_user (username,password,regtime) VALUES (?, ?, ?)",
        profile: "INSERT INTO et_user_profile (user_id, nickname) VALUES (?, ?)"
    },
    profile: 'SELECT u.username,p.* FROM et_user u LEFT JOIN et_user_profile p ON p.user_id = u.id WHERE u.id = ? limit 1',
    group: 'SELECT g.id,g.name, o.nickname, g.owner,g.capacity,g.size,g.createtime FROM et_group_user gu ' +
    'LEFT JOIN et_group g ON g.id = gu.group_id ' +
    'LEFT JOIN et_user_profile o ON o.user_id = g.owner ' +
    'WHERE gu.user_id = ?',
    friends: 'SELECT u.nickname,u.user_id,u.avatar FROM et_friend f ' +
    'LEFT JOIN et_user_profile u ON u.user_id = f.user2_id ' +
    'WHERE f.user1_id = ?',
    grouplist: 'SELECT u.nickname,u.user_id FROM et_group_user gu ' +
    'LEFT JOIN et_user_profile u ON u.user_id = gu.user_id ' +
    'WHERE gu.group_id = ?',
    modify:{
        tel: 'UPDATE et_user_profile SET tel = ? WHERE user_id = ?',
        email: 'UPDATE et_user_profile SET email = ? WHERE user_id = ?',
        qq: 'UPDATE et_user_profile SET qq = ? WHERE user_id = ?'
    }
}